import { defineStore } from "pinia"
import type {IRegister} from '@/types/types'
export const userStore = defineStore('registerCount', {
    state() {
        return {
            registerCount: {
                username: '',
                password: '',
            },
        }
    },
    actions: {
        saveRegisterCount(data: IRegister) {
            this.registerCount = data
        },
    },
    getters: {
        getRegisterCount(): IRegister {
            return this.registerCount
        },
    },
    persist: {
        enabled: true,
        strategies: [
            {
                key: 'registerCount', //设置存储的key
                storage: localStorage, //表示存储在localStorage
            },
        ],
    },
})